/**
 * 
 */
package com.example.validation.controler;


import javax.validation.Valid;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;

/**
 * @author xiazhengjiao
 * @date 2019年5月31日
 */
@Produces({ MediaType.APPLICATION_JSON_UTF8_VALUE })
@Consumes({ MediaType.APPLICATION_JSON_UTF8_VALUE })
@RestController
public class TestController {

	@PostMapping("/test1")
	public Object test1(@Valid @RequestBody DemoDTO dto) {
		return JSON.toJSONString(dto);
	}
}
